import { defineStore } from 'pinia'
import { ref } from 'vue'
export const SetID = defineStore('setIDStore', () => {
    //定义会话id
    const C_ID = ref(0)
    //是否是初始化会话id
    const isInitialized=ref(false)
    //初始化会话id
    function initializeID(id) {
        if (!isInitialized.value) {
            C_ID.value = id
            isInitialized.value=true
        }
    }

    //设置会话id
    function setID(id) {
        C_ID.value = id
    }

    //获取绘画id
    function getID() {
        return C_ID.value
    }

    //移除会话id
    function removeID() {
        C_ID.value=0
    }

    return {C_ID,isInitialized,initializeID,setID,getID,removeID}
})